﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VirtualPress.Infrastructure.Entities.Repository;

namespace VirtualPress.Infrastructure.Entities.Entity
{
    public class ConferenceMapping : IAccessible<C_ConferenceMapping, ConferenceMapping>, ILogicEntity<C_ConferenceMapping, ConferenceMapping>
    {
        public string Host { get; set; }

        public int ConferenceId { get; set; }


        protected override void Covariant(C_ConferenceMapping model)
        {
            if (model != null)
            {
                this.Host = model.Host;
                this.ConferenceId = model.ConferenceId;
            }
        }

        protected override C_ConferenceMapping Inverter(ConferenceMapping model)
        {
            if (model != null)
            {
                return new C_ConferenceMapping()
                {
                    ConferenceId = model.ConferenceId,
                    Host = model.Host
                };
            }
            return null;
        }

        public ConferenceMapping Set(C_ConferenceMapping dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
